import java.util.function.Function;

public class Demo11FunctionApply {
    private static void method(Function<String, Integer> function, String str) {
        int num = function.apply(str);
        System.out.println(num + 20);
    }

    public static void main(String[] args) {
//        method(s -> Integer.parseInt(s), "10");
        method(new Function<String, Integer>() {
            @Override
            public Integer apply(String s) {
                int length = s.length();
                return length;
            }
        },"abcde");
    }

}
